{literal}
    <style type="text/css">		
        .upload-progress {
            border:1px dashed #333333;
            width:500px;
            height:50px;
        }

        .upload-progress div.meter {
            width:0px;
            height:15px;
            font-size:1px;
            background-color:#fe03b4;
            margin-left:10px;
            margin-top:1px;
            border:1px solid black;
        }

        .upload-progress div.readout {
            padding:5px 0px 0px 12px;
            font-family:"Courier New", Courier, monospace;
            font-size:10px;
            line-height:10px;
        }

        .upload-progress div.readout span {
            font-weight:bold;
        }
    </style>
{/literal}
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<!--<script type="text/javascript">/*<![CDATA[*/ google.load("jquery", "1.3.2"); /*]]>*/</script> -->
<script type="text/javascript">/*<![CDATA[*/ google.load("jqueryui", "1.7.2"); /*]]>*/</script>
<script type="text/javascript">
    var $j = jQuery.noConflict();
</script>
<script type="text/javascript" src="{$baseurl}/js/jquery.uploadprogress.0.3.js"></script>
{literal}
    <script type="text/javascript">
    jQuery(function () {
            jQuery('#upload_form').uploadProgress({ 
                    progressURL:'upload.php',
                    displayFields : ['kb_uploaded','kb_average','est_sec'],
                    start: function() { 
                            jQuery('input[type=submit]',this).val('{/literal}{$lang119}{literal}');
                    },
                    success: function() { 
                            jQuery('input[type=submit]',this).val('{/literal}{$lang454}{literal}');
                            jQuery(this).get(0).reset();
                            document.getElementById('smsg').style.display="block";
                    }
            });
    });
    </script>
    <script type="text/javascript">
    function checkuploadForm()
    {
            title = document.getElementById("title").value;
            tags = document.getElementById("tags").value;
            artist = document.getElementById("artist").value;
            desc = document.getElementById("vwdescription").value;
            category = document.getElementById("category").value;
            audio_file = document.getElementById("audio_file").value;
	
            if (title == "")
            {
                    hideAllErrors();
                    document.getElementById("titleError").style.display = "block";
                    document.getElementById("title").select();
                    document.getElementById("title").focus();
                    return false;
            } 
            else if (tags == "")
            {
                    hideAllErrors();
                    document.getElementById("tagsError").style.display = "block";
                    document.getElementById("tags").select();
                    document.getElementById("tags").focus();
                    return false;
            }
            else if(artist == "")
            {
                    hideAllErrors();
                    document.getElementById("artistError").style.display = "block";
                    document.getElementById("artist").select();
                    document.getElementById("artist").focus();
                    return false;
            }
            else if (desc == "")
            {
                    hideAllErrors();
                    document.getElementById("vwdescriptionError").style.display = "block";
                    document.getElementById("vwdescription").select();
                    document.getElementById("vwdescription").focus();
                    return false;
            }
            else if (category == "0")
            {
                    hideAllErrors();
                    document.getElementById("categoryError").style.display = "block";
                    return false;
            }
            else if (audio_file == "")
            {
                    hideAllErrors();
                    document.getElementById("fileError").style.display = "block";
                    return false;
            }
            else if (audio_file != "")
            {
                    if (LimitAttach("upload_form", audio_file))
                    {
                            return true;
                    }
                    else
                    return false;
            }
	
            return true;
    }

    function LimitAttach(form, file)
    {
            extArray = new Array(".mp3", ".MP3");
            allowSubmit = false;
            if (!file) return;
            while (file.indexOf("\\") != -1)
            file = file.slice(file.indexOf("\\") + 1);
            ext = file.slice(file.lastIndexOf(".")).toLowerCase();
            for (var i = 0; i < extArray.length; i++) {
            if (extArray[i] == ext) { allowSubmit = true; break; }
            }
            if (allowSubmit) return true;
            else
            alert("{/literal}{$lang121}{literal}  "
            + (extArray.join("  ")) + "\n{/literal}{$lang120}{literal}");
            return false;
    }
 
    function hideAllErrors() 
    {
            document.getElementById("titleError").style.display = "none"
            document.getElementById("tagsError").style.display = "none"
            document.getElementById("vwdescriptionError").style.display = "none"
            document.getElementById("categoryError").style.display = "none"
            document.getElementById("fileError").style.display = "none"
    }

    function uploadPreCheck() 
    {
            if (checkuploadForm())
            {		
                    hideAllErrors();
                    jQuery('#upload_form').submit();
            }
            else
             return false;
    }
    </script>
{/literal}
<div id="main_wrap">
    <div class="center_wrap clearfix">
        <h2>{$lang797}</h2>
        <div id="public_wrap_sm">
            {if $error2 ne "1"}
                <form name="upload_form" id="upload_form" enctype="multipart/form-data" action="{$baseurl}/upload.php" method="POST">
                    <input type="hidden" name="UPLOAD_IDENTIFIER" id="UPLOAD_IDENTIFIER" value="{$upload_id}" />
                    <div id="smsg" class="errorPage clearfix" style="display:none">
                        <h2 style="font-size:18px">{$lang167}</h2>
                    </div>
                    <p>
                        <label for="user_login">{$lang324}</label>
                        <input name="title" id="title" type="text" value="{$title|stripslashes}" size="30" /><br />
                    <div class="uerror" id="titleError">{$lang854}</div>
                    </p>
                    <p>
                        <label for="user_password">{$lang325}</label>
                        <input type="text" name="tags" value="{$tags|stripslashes}" size="30" id="tags" /><br/>
                    <div class="uerror" id="tagsError">{$lang855}</div>
                    </p>              
                    <p>
                        <label for="artist">Artist</label>
                        <input type="text" name="artist" value="{$artist|stripslashes}" size="30" id="artist" /><br/>
                        <div class="uerror" id="artistError">Error: Please enter artist name.</div>
                    </p>   
                    <p>
                        <label for="country">Country</label>
                        <select id="artist_country" name="artist_country">
                            <option value="">Select country</option>
                        {$countriesList}
                        </select><br/>
                        <div class="uerror" id="countryError">Error: Please select a country.</div>    
                    </p>
                    <p>
                        <label for="user_password">{$lang113}</label>
                        <textarea name="vwdescription" id="vwdescription" rows="4" cols="35">{$desc|stripslashes}</textarea><br/>
                    <div class="uerror" id="vwdescriptionError">{$lang856}</div>
                    </p> 
                    <p>
                        <label for="user_login">{$lang218}</label>
                        <select id="category" name="category" style="font-size:14px; width:260px;">
                            <option value="0">{$lang115}</option>
                            {insert name=get_audio_categories assign=listaudiocategories}
                            {section name=o loop=$listaudiocategories}
                                <option value="{$listaudiocategories[o].CATID}" {if $category eq $listaudiocategories[o].CATID}selected="selected"{/if}>{$listaudiocategories[o].name}</option>
                            {/section}
                        </select><br />
                    <div class="uerror" id="categoryError">{$lang462}</div>
                    </p>

                    <p>
                    <div style="height:10px;"></div>
                    {$lang329}:&nbsp;
                    <input class="check" type="radio" value="1" name="public" id="public" checked> {$lang327}&nbsp;&nbsp;&nbsp;
                    <input class="check" type="radio" value="0" name="public" id="public"> {$lang328}
                    <div style="height:10px;"></div>

                    {$lang330}:&nbsp;
                    <input class="check" type="radio" value="1" name="allowcomments" id="allowcomments" checked> {$lang335}&nbsp;&nbsp;&nbsp;
                    <input class="check" type="radio" value="0" name="allowcomments" id="allowcomments"> {$lang336}
                    <div style="height:10px;"></div>

                    {$lang331}:&nbsp;
                    <input class="check" type="radio" value="1" name="allowratings" id="allowratings" checked> {$lang335}&nbsp;&nbsp;&nbsp;
                    <input class="check" type="radio" value="0" name="allowratings" id="allowratings"> {$lang336}
                    <div style="height:10px;"></div>

                    {$lang332}:&nbsp;
                    <input class="check" type="radio" value="1" name="allowembeds" id="allowembeds" checked> {$lang335}&nbsp;&nbsp;&nbsp;
                    <input class="check" type="radio" value="0" name="allowembeds" id="allowembeds"> {$lang336}
                    <div style="height:10px;"></div>

                    {$lang333}:&nbsp;
                    <input class="check" type="radio" value="1" name="allowdownloads" id="allowdownloads" checked> {$lang335}&nbsp;&nbsp;&nbsp;
                    <input class="check" type="radio" value="0" name="allowdownloads" id="allowdownloads"> {$lang336}
                    <div style="height:10px;"></div>
                    </p>

                    <p>
                        <label for="audio_file">{$lang210}</label>
                        <input type="file" name="audio_file" id="audio_file" class="textField" size="30"/><br /><small>({$lang148} {$lang149})</small><br />
                    <div class="uerror" id="fileError">{$lang857}</div>
                    </p>

                    <p>
                        <label for="audiopictureimage">{$lang299}</label>
                        <input type="file" name="audiopictureimage" id="audiopictureimage" class="textField" size="30"/><br /><small>({$lang211})</small>
                    </p>

                   <!-- <p>
                    <div class="upload-progress">
                        <div class="readout">
                            <span class="kb_uploaded">0</span> {$lang69} - <span class="kb_average">0</span> {$lang70} <br/><span class="est_sec">0</span> {$lang73}
                        </div>
                        <div class="meter"></div>
                    </div>
                    </p>-->

                    <p>
                        <input type="button" name="upload_button" id="upload_button" value="{$lang177}" onClick="uploadPreCheck();" />
                    </p>

                </form>
            {else}
                <div class="errorPage clearfix">
                    <h2 style="font-size:18px">{$lang835}</h2>
                </div>
            {/if}

        </div>      
        <div class="clear"></div>
    </div>
</div>